package com.wsc.wsckeeper.persistence.dao;

import java.sql.SQLException;
import java.util.List;

import com.j256.ormlite.dao.Dao;
import com.wsc.wsckeeper.model.entity.CardE;

@SuppressWarnings("rawtypes")
public class CardDAO extends GenericDao {

	public static List<CardE> queryForAll() throws SQLException, Exception {
		Dao<CardE, Long> dao = getCardDao();
		List<CardE> cards = dao.queryForAll();
		return cards;
	}

	public static CardE create(CardE card) throws SQLException, Exception {
		Dao<CardE, Long> dao = getCardDao();
		dao.create(card);
		return card;
	}

	public static int update(CardE card) throws SQLException, Exception {
		Dao<CardE, Long> dao = getCardDao();
		return dao.update(card);
	}

	public static int delete(CardE card) throws SQLException, Exception {
		Dao<CardE, Long> dao = getCardDao();
		return dao.delete(card);
	}
}
